// 操作数据库API

import axios from "../apiWrapper"

axios.defaults.baseURL = "http://localhost:8081/django"


// 改变状态码
/*param: PMC1,PMC2,PMC3*/
export const updateState = (param, state) => {
    return axios.get(`database/update/?PMCIDs=${param}&state=${state}`)
}

// 查询状态码
export const selectState = (pmcList) => {
    let PMCIDs = pmcList.join();
    return axios.get(`database/select/state/?PMCIDs=${PMCIDs}`)
}

// 查询整行数据
export const selectAll = (pmcList, term) => {
    let PMCIDs = pmcList.join();
    return axios.get(`database/select/all/?PMCIDs=${PMCIDs}&term=${term}`)
}

// 查询整篇文章
export const selectArtical = (PMCID) => { 
    return axios.get(`database/select/article/?PMCID=${PMCID}`)
}